package hmvictor.jpql.types;

import java.util.Objects;
import javax.persistence.Parameter;
import javax.persistence.Query;

/**
 *
 * @author Victor
 */
public class DefaultType extends  AbstractParameterType{
    private final ValueConverter converter;

    public DefaultType(String name, ValueConverter converter) {
        super(name);
        this.converter = converter;
    }
    
    @Override
    public Editor createEditor() {
        return new TextFieldBasedEditor(converter);
    }

    @Override
    public void setParameter(Query query, Parameter parameter, Object value) {
        query.setParameter(parameter, value);
    }

}
